﻿
@{
    ViewBag.Title = Resources.WebStringsWeb.WebTitle;
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}
@section css {
    <link href="~/Assets/css/lib/bootstrap-select.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/bootstrap-datetimepicker.min.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/fileinput.css" rel="stylesheet" />
    <style>
        th {
            text-align: center;
            font-weight: bold;
        }

        td {
            text-align: center;
            vertical-align: middle;
        }
        .center {
            position: fixed;
            top: 50%;
            left: 50%;
            background-color: #000;
            width: 600px;
            -webkit-transform: translateX(-50%) translateY(-50%);
            -moz-transform: translateX(-50%) translateY(-50%);
            -ms-transform: translateX(-50%) translateY(-50%);
            transform: translateX(-50%) translateY(-50%);
            border-radius: 3px;
        }
        .removeImage {
            position: relative;
            right: -55px;
            top: -12px;
            float:left;
            font-weight:bold;
            color:red;
        }
    </style>
}
<div class="page-content" ng-cloak ng-controller="CheckFormController" ng-init="
     page = '@(Request.QueryString["page"].IsEmpty() ? "1" : Request.QueryString["page"])';
     PageName='@(Request.QueryString["PageName"].IsEmpty() ? "" : Request.QueryString["PageName"])';
     FormId ='@(Request.QueryString["FormId"].IsEmpty() ? "" : Request.QueryString["FormId"])';
     GetCheckDetail(FormId);
     CheckItems=[];
     ImageCount = [0,1,2,3,4];
     ">
    <div class="load" ng-show="DataLoading">
        <div class="loader">
            <svg version="1.1" id="loader-1" x="0px" y="0px" width="100px" height="100px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
            <path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
            <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite" />
			</path>
		</svg>
            <div class="load-msg" ng-bind="LoadingMsg"></div>
        </div>
    </div>
    <div class="load" id="previewimg" ng-show="IsPreview" ng-click="ClosePreview();">
        <img id="imgshow" class="center" />
    </div>
    <div class="page-heading">
        <h1>检查编辑</h1>
        <div class="options">
            <div class="btn-toolbar">

            </div>
        </div>
    </div>
    <ol class="breadcrumb">
        <li><a>主体业务</a></li>
        <li><a>安全检查</a></li>
        <li><a>日常检查</a></li>
        <li class="active"><a>检查编辑</a></li>
    </ol>

    <div class="container-fluid">
        <div class="row">
            <form class="form-horizontal row-border">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading"><h2>检查编辑</h2></div>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-sm-1 control-label"><b style="color:red;"></b>部门：</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" ng-model="CheckDetail.DepartmentName" readonly />
                                </div>
                                <label class="col-sm-1 control-label"><b style="color:red;"></b>部位名称：</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" ng-model="CheckDetail.RoomName" readonly />
                                </div>
                                <label class="col-sm-1 control-label"><b style="color:red;"></b>部门负责人：</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" ng-model="CheckDetail.Manager" readonly />
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label"><b style="color:red;"></b>责任人：</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" ng-model="CheckDetail.CreateUserName" readonly />
                                </div>
                                <label class="col-sm-1 control-label"><b style="color:red;"></b>检查日期：</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" ng-model="CheckDetail.CheckTime" readonly />
                                </div>
                                <label class="col-sm-1 control-label"><b style="color:red;"></b>检查类型：</label>
                                <div class="col-sm-3">
                                    <input type="text" class="form-control" ng-model="CheckDetail.CheckTypeName" readonly />
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-12">
                                    <table class="table table-striped table-bordered table-hover" ng-show="!PageLoading">
                                        <thead>
                                            <tr>
                                                <th style="width:5%;">序号</th>
                                                <th style="width:40%;">检查内容</th>
                                                <th style="width:10%;">检查结果</th>
                                                <th style="width:5%;">数值</th>
                                                <th style="width:15%;">照片</th>
                                                <th style="width:20%;">备注</th>
                                                @*<th>操作</th>*@
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr ng-repeat="x in CheckDetail.CheckItemList track by $index">
                                                <td>{{$index+1}}</td>
                                                <td style="text-align:left;">{{x.CheckContent}}</td>
                                                <td>
                                                    <label class="radio-inline" ng-click="x.Result=1">
                                                        <input type="radio" ng-checked="x.Result==1" name="CheckItem_{{x.Id}}">是
                                                    </label>
                                                    <label class="radio-inline" ng-click="x.Result=0">
                                                        <input type="radio" ng-checked="x.Result==0" name="CheckItem_{{x.Id}}"> 否
                                                    </label>
                                                </td>
                                                <td>
                                                    <input type="text"  ng-model="x.DataValue" class="form-control" ng-show="x.IsValue" />
                                                    <b ng-show="!x.IsValue">一</b>
                                                </td>
                                                <td>
                                                    <div style="float:left;margin-left:10px;width:60px;" ng-repeat="i in ImageCount" id="imagebox-{{x.OptionId}}_{{i}}">

                                                    </div>
                                                </td>
                                                <td><input type="text" class="form-control" ng-model=" x.Remark" /></td>
                                                @*<td>
                                                    <a class="btn btn-primary btn-xs btn-label" ng-click="UpdateCheckFormItem(x);"><i class="fa fa-pencil"></i>更新</a>
                                                </td>*@
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>

                            </div>
                        </div>
                        <div class="panel-footer">
                            <div class="col-md-4">
                            </div>
                            <div class="col-md-1">
                                <button class="btn-primary btn" ng-click="UpdateFormStatus(FormId,0,page);">保存</button>
                            </div>
                            <div class="col-md-1">
                                <button class="btn-primary btn" ng-click="UpdateFormStatus(FormId,1,page);">提交</button>
                            </div>
                            <div class="col-md-1">
                                <a href="DailyCheckFormPageList?page={{page}}" class="btn-default btn">返回</a>
                            </div>
                            <div class="col-md-3">
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>

    </div>

</div>


@section Js{
    <script src="~/Assets/js/libs/upload.js"></script>
    <script src="~/Assets/js/pg/CheckForm.js?v=@DateTime.Now.ToString("yyMMddHHmm")"></script>
}
